<!DOCTYPE html>
<html>
    <head>
        <title><g:layoutTitle default="Grails" /></title>
        <link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" />
        <link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
        <link rel="stylesheet" href="${resource(dir:'menu',file:'menu_style.css')}" />
        <g:layoutHead />
        <g:javascript library="application" />
    </head>
    <body>
        <div id="spinner" class="spinner" style="display:none;">
            <img src="${resource(dir:'images',file:'spinner.gif')}" alt="${message(code:'spinner.alt',default:'Loading...')}" />
        </div>
        <div id="grailsLogo"><a href="http://grails.org"><img src="${resource(dir:'images',file:'grails_logo.png')}" alt="Grails" border="0" /></a></div>
        <div id="pageBody">
            <div id="controllerList" class="dialog">
			    <div>
			        <h:toolBar classUL="menu">
			            <h:menuItem classLI="top" classAnchor="top_link" href="${createLink(uri: '/')}">
			                <span><g:message code="default.home.label" /></span>
			            </h:menuItem>

			            <h:dropDownMenu classLI="top" 
			                            classAnchor="top_link" 
			                            classUL="sub" 
			                            label="default.cadastrar.label">
		                    <h:menuItem perfil="ROLE_ADMIN" action="/usuario/create"><g:message code="usuario.label" /></h:menuItem>
		                    <h:menuItem perfil="ROLE_ADMIN" action="/role/create"><g:message code="role.label" /></h:menuItem>
		                    <h:menuItem action="/cidade/create"><g:message code="cidade.label" /></h:menuItem>
			            </h:dropDownMenu>

			            <h:dropDownMenu classLI="top" 
			                            classAnchor="top_link" 
			                            classUL="sub" 
			                            label="default.buscar.label">
			                <h:menuItem action="/usuario/list" perfil="ROLE_ADMIN"><g:message code="usuario.label" /></h:menuItem>
			                <h:menuItem action="/role/list" perfil="ROLE_ADMIN"><g:message code="role.label" /></h:menuItem>
			                <h:menuItem action="/cidade/list"><g:message code="cidade.label" /></h:menuItem>
			            </h:dropDownMenu>

						<h:isLoggedIn>
			                <h:menuItem classLI="top" classAnchor="top_link" action="/logout/logout">
			                    <span><g:message code="default.logout.label" /></span>
			                </h:menuItem>
			            </h:isLoggedIn>

						<h:isNotLoggedIn>
			                <h:menuItem classLI="top" classAnchor="top_link" action="/login/login">
			                    <span><g:message code="default.login.label" /></span>
			                </h:menuItem>
			            </h:isNotLoggedIn>
			        </h:toolBar>
			    </div>
            </div>
        </div>
        
        <g:layoutBody />
        
    </body>
</html>